'''
Created on Apr 26, 2011

@author: root

Entry point of the whole web application
'''
"this two lines add the current folder path to module searching path"
import os,sys
reload(sys)
sys.setdefaultencoding('UTF-8')

sys.path.append(os.path.abspath(os.path.dirname(__file__)))
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))

"set the python egg cache folder to /tmp, instead of its default folder"
os.environ['PYTHON_EGG_CACHE'] = '/tmp'
os.environ['LD_LIBRARY_PATH'] = '/usr/local/lib'

from includes import web
from controller import *
from mobile_urls import *


""" this is a wsgi function, called by apache + mod_wsgi"""
application = web.application(urls, globals()).wsgifunc()

if __name__ == "__main__" :
    """ Test it with web.py's built-in server"""
    web.config.debug = True
    app = web.application(urls, globals())
    app.run()
